home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / ms_acces / mdbguru / truevs.frt (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-25  |  8.0 KB  |  239 lines

  1. VERSION 2.00
  2. Begin Form <<formname>>
  3.    Caption         =   "<<caption>>"
  4.    ClientHeight    =   6255
  5.    ClientLeft      =   1185
  6.    ClientTop       =   1575
  7.    ClientWidth     =   9420
  8.    Height          =   6660
  9.    Left            =   1125
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   6255
  12.    ScaleWidth      =   9420
  13.    Tag             =   "<<formname>>"
  14.    Top             =   1230
  15.    Width           =   9540
  16.    Begin Data dtaCtr 
  17.       Caption         =   "<<formname>>"
  18.       Connect         =   "<<connectstring>>"
  19.       DatabaseName    =   "<<database>>"
  20.       Exclusive       =   0   'False
  21.       Height          =   270
  22.       Left            =   5280
  23.       Options         =   0
  24.       ReadOnly        =   0   'False
  25.       RecordSource    =   "<<recordsource>>"
  26.       Top             =   60
  27.       Visible         =   0   'False
  28.       Width           =   3000
  29.    End
  30.    Begin VideoSoftElastic VSElastic1 
  31.       Align           =   5  'Fill Container
  32.       AutoSizeChildren=   1  'Even Horizontal
  33.       BevelInner      =   0  'None
  34.       BevelOuter      =   0  'None
  35.       Height          =   6255
  36.       IntBkg          =   &H00C0C0C0&
  37.       Left            =   0
  38.       TabIndex        =   21
  39.       Top             =   0
  40.       Width           =   9420
  41.       Begin VideoSoftIndexTab tab<<formname>>
  42.          BackSheets      =   0  'None
  43.          Caption         =   "Browse|Details"
  44.          FontBold        =   0   'False
  45.          FontItalic      =   0   'False
  46.          FontName        =   "MS Sans Serif"
  47.          FontSize        =   8.25
  48.          FontStrikethru  =   0   'False
  49.          FontUnderline   =   0   'False
  50.          FrontTabColor   =   &H00C0C0C0&
  51.          Height          =   6075
  52.          Left            =   90
  53.          New3D           =   -1  'True
  54.          Position        =   0  'Top
  55.          Style           =   7  'Straight 3D
  56.          TabIndex        =   22
  57.          Top             =   90
  58.          Width           =   9240
  59.          Begin VideoSoftElastic VSElastic4 
  60.             AutoSizeChildren=   1  'Even Horizontal
  61.             BevelOuter      =   0  'None
  62.             Height          =   5730
  63.             IntBkg          =   &H00C0C0C0&
  64.             Left            =   12330
  65.             TabIndex        =   0
  66.             Top             =   315
  67.             Width           =   9180
  68.          End
  69.          Begin VideoSoftElastic VSElastic3 
  70.             AccessKey       =   -1  'True
  71.             BevelOuter      =   0  'None
  72.             CaptionPos      =   6  'Right Top
  73.             CaptionStyle    =   4  'Inset Light
  74.             FontBold        =   0   'False
  75.             FontItalic      =   0   'False
  76.             FontName        =   "MS Sans Serif"
  77.             FontSize        =   8.25
  78.             FontStrikethru  =   0   'False
  79.             FontUnderline   =   0   'False
  80.             Height          =   5730
  81.             IntBkg          =   &H00C0C0C0&
  82.             Left            =   12255
  83.             TabIndex        =   24
  84.             TagWidth        =   1500
  85.             Top             =   315
  86.             Width           =   9180
  87.             <<fieldcontrols>>
  88.          End
  89.          Begin VideoSoftElastic VSElastic2 
  90.             AutoSizeChildren=   1  'Even Horizontal
  91.             BevelOuter      =   0  'None
  92.             Height          =   5730
  93.             IntBkg          =   &H00C0C0C0&
  94.             Left            =   30
  95.             TabIndex        =   23
  96.             Top             =   315
  97.             Width           =   9180
  98.             Begin TrueGrid tbl<<formname>>
  99.                AllowArrows     =   -1  'True
  100.                AllowTabs       =   -1  'True
  101.                BackColor       =   &H0080FFFF&
  102.                DataSource      =   "dtaCtr"
  103.                Editable        =   -1  'True
  104.                EditDropDown    =   -1  'True
  105.                ExposeCellMode  =   0  'Expose upon selection
  106.                FetchMode       =   0  'By cell
  107.                FontBold        =   0   'False
  108.                FontItalic      =   0   'False
  109.                FontName        =   "MS Sans Serif"
  110.                FontSize        =   8.25
  111.                FontStrikethru  =   0   'False
  112.                FontUnderline   =   0   'False
  113.                HeadingHeight   =   1
  114.                Height          =   5550
  115.                HorzLines       =   2  '3D
  116.                LayoutIndex     =   1
  117.                Left            =   90
  118.                LinesPerRow     =   1
  119.                MarqueeUnique   =   -1  'True
  120.                SplitPropsGlobal=   -1  'True
  121.                SplitTabMode    =   0  'Don't tab across splits
  122.                TabCapture      =   0   'False
  123.                TabIndex        =   19
  124.                Top             =   90
  125.                UseBookmarks    =   -1  'True
  126.                Width           =   9000
  127.                WrapCellPointer =   0   'False
  128.             End
  129.          End
  130.       End
  131.    End
  132.    Begin Label lblMsg 
  133.       Caption         =   "Label1"
  134.       Height          =   255
  135.       Left            =   3300
  136.       TabIndex        =   20
  137.       Top             =   60
  138.       Width           =   1875
  139.    End
  140. Option Explicit
  141. Dim lSave As Integer
  142. Sub Form_Activate ()
  143.     activateToolBar Tag
  144.     setSave lSave
  145. End Sub
  146. Sub Form_Load ()
  147.     Dim cLay As String
  148.     lSave = False
  149.     activateToolBar Tag
  150.     setSave lSave
  151.     cLay = loadGridSetup(Me.Tag)
  152.     If cLay <> "" Then tbl<<formname>>.Layout = cLay
  153.     dtaCtr.DatabaseName = gcMainPath + APPLICATION_DB
  154.     dtaCtr.Refresh
  155. End Sub
  156. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  157.     If lSave Then
  158.         If Not yesno("Changes will be lost.  Close anyway?", "Close") Then
  159.             Exit Sub
  160.         Else
  161.             Cancel = True
  162.         End If
  163.     End If
  164. End Sub
  165. Sub Form_Unload (Cancel As Integer)
  166.     deactivateToolBar
  167.     saveGridSetup (Me.Tag), (tbl<<formname>>.Layout)
  168. End Sub
  169. Sub lblMsg_Change ()
  170.     On Error GoTo cantMove
  171.     Select Case lblMsg.Caption
  172.         Case ""
  173.             ' do nothing
  174.             Exit Sub
  175.         Case MSG_ADD
  176.             lSave = True
  177.             setSave True
  178.             dtaCtr.Recordset.AddNew
  179.             tab<<formname>>.CurrTab = 1
  180.         Case MSG_EDIT
  181.             lSave = True
  182.             setSave True
  183.             
  184.             dtaCtr.Recordset.Edit
  185.             tab<<formname>>.CurrTab = 1
  186.         Case MSG_DELETE
  187.             ' todo:  needs integrity check
  188.             If yesno("Are you sure you want to delete the current record?", "Delete") Then
  189.                 dtaCtr.Recordset.Delete
  190.             End If
  191.             
  192.         Case MSG_CANCEL
  193.             lSave = False
  194.             setSave False
  195.             dtaCtr.Recordset.Edit
  196.             dtaCtr.Recordset.Update
  197.         Case MSG_SAVE
  198.             lSave = False
  199.             setSave False
  200.             dtaCtr.Recordset.Update
  201.             dtaCtr.Recordset.Bookmark = dtaCtr.Recordset.LastModified
  202.         Case MSG_REFRESH
  203.             dtaCtr.Refresh
  204.         Case MSG_PRINT
  205.             
  206.         
  207.         Case MSG_CLOSE
  208.             lblMsg.Caption = "" ' must do this first or doing it later will reload the form
  209.             Unload Me
  210.             Exit Sub
  211.         Case MSG_MOV_FIRST
  212.             dtaCtr.Recordset.MoveFirst
  213.         Case MSG_MOV_PREV
  214.             dtaCtr.Recordset.MovePrevious
  215.             If dtaCtr.Recordset.BOF Then
  216.                 dtaCtr.Recordset.MoveFirst
  217.                 Beep
  218.             End If
  219.                            
  220.         Case MSG_MOV_NEXT
  221.             dtaCtr.Recordset.MoveNext
  222.             If dtaCtr.Recordset.EOF Then
  223.                 dtaCtr.Recordset.MoveLast
  224.                 Beep
  225.             End If
  226.         Case MSG_MOV_LAST
  227.             dtaCtr.Recordset.MoveLast
  228.     End Select
  229.     lblMsg.Caption = ""
  230.     'bOk(0).Enabled = False
  231.     Exit Sub
  232. cantMove:
  233.     ErrorMsg "Unable to move records: " & Error$
  234.     Exit Sub
  235. End Sub
  236. Sub tab<<formname>>_Switch (OldTab As Integer, NewTab As Integer, Cancel As Integer)
  237.     If lSave And NewTab = 0 Then Cancel = True
  238. End Sub
  239.